__author__ = 'panagiotis'


nb_clf = MultinomialNB()
transformer = DocVectorizer(n_features=65, tokenize=False, lemmatize=False)
nb_clf.fit(transformer.fit_transform(train_titles), train_target)
print "Titles MultinomialNB",
print [(precision_score(test_target, res), recall_score(test_target, res), f1_score(test_target, res)) for res in [nb_clf.predict(transformer.transform(test_titles))]]


nb_clf = MultinomialNB()
transformer = DocVectorizer(n_features=90, tokenize=False, lemmatize=True)
nb_clf.fit(transformer.fit_transform(train_review), train_target)
print "Reviews MultinomialNB",
print [(precision_score(test_target, res), recall_score(test_target, res), f1_score(test_target, res)) for res in [nb_clf.predict(transformer.transform(test_review))]]


nb_clf = LogisticRegression()
transformer = DocVectorizer(n_features=55, tokenize=False, lemmatize=False)
nb_clf.fit(transformer.fit_transform(train_titles), train_target)
print "Titles MaxEntropy",
print [(precision_score(test_target, res), recall_score(test_target, res), f1_score(test_target, res)) for res in [nb_clf.predict(transformer.transform(test_titles))]]


nb_clf = LogisticRegression()
transformer = DocVectorizer(n_features=50, tokenize=False, lemmatize=True)
nb_clf.fit(transformer.fit_transform(train_review), train_target)
print "Reviews MaxEntropy",
print [(precision_score(test_target, res), recall_score(test_target, res), f1_score(test_target, res)) for res in [nb_clf.predict(transformer.transform(test_review))]]


nb_clf = LinearSVC()
transformer = DocVectorizer(n_features=40, tokenize=False, lemmatize=True)
nb_clf.fit(transformer.fit_transform(train_titles), train_target)
print "Titles LinearSVM",
print [(precision_score(test_target, res), recall_score(test_target, res), f1_score(test_target, res)) for res in [nb_clf.predict(transformer.transform(test_titles))]]


nb_clf = LinearSVC()
transformer = DocVectorizer(n_features=90, tokenize=False, lemmatize=False)
nb_clf.fit(transformer.fit_transform(train_review), train_target)
print "Reviews LinearSVM",
print [(precision_score(test_target, res), recall_score(test_target, res), f1_score(test_target, res)) for res in [nb_clf.predict(transformer.transform(test_review))]]


nb_clf = SVC()
transformer = DocVectorizer(n_features=65, tokenize=False, lemmatize=False)
nb_clf.fit(transformer.fit_transform(train_titles), train_target)
print "Titles SVMRBF",
print [(precision_score(test_target, res), recall_score(test_target, res), f1_score(test_target, res)) for res in [nb_clf.predict(transformer.transform(test_titles))]]



nb_clf = SVC()
transformer = DocVectorizer(n_features=135, tokenize=False, lemmatize=True)
nb_clf.fit(transformer.fit_transform(train_review), train_target)
print "Reviews SVMRBF",
print [(precision_score(test_target, res), recall_score(test_target, res), f1_score(test_target, res)) for res in [nb_clf.predict(transformer.transform(test_review))]]

